##cmake_minimum_required( VERSION 2.8 )
project("konkordo client logon plugin")
find_package( Qt4 REQUIRED )

ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)

include( ${QT_USE_FILE} )
INCLUDE_DIRECTORIES(
    ${QT_INCLUDE_DIR}
    ${QT_QTSQL_INCLUDE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
    ../../../interfaces
)


set( HEADERS
    stdlogon.h
    dialogon.h
)

set( SOURCES
    stdlogon.cpp
    dialogon.cpp
)

set( UIS
    dialogon.ui
)

qt4_wrap_ui(UIS_H ${UIS})
qt4_wrap_cpp(MOC ${HEADERS})

add_library(stdlogon SHARED ${SOURCES} ${MOC} ${UIS_H} )

target_link_libraries(stdlogon ${QT_LIBRARIES})

# install for linux
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
        set(rootdir ${CMAKE_INSTALL_PREFIX})
        set(libdir ${rootdir}/lib/konkordo)
        install(TARGETS stdlogon DESTINATION ${libdir})
endif()

# install for mac
if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
        set(rootdir ${CMAKE_INSTALL_PREFIX})
        set(libdir ${rootdir}/lib/konkordo)
        install(TARGETS stdlogon DESTINATION ${libdir})
endif()

